<%-- 
    Document   : getEstruturas
    Created on : 06/07/2010, 17:15:56
    Author     : aroaldo.soares
--%>
<%@taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8" language="java"%>
<%@include file="../WEB-INF/jspf/controlesessao.jspf"%>
<html>
    <head>

    </head>
    <body>
        <p>
            <sql:query var="query" dataSource="jdbc/dbo_MicrosoftSQLServer">
                SELECT  e.*, s.id_sala FROM Estruturas e
                    left join Estruturas_Salas s on s.id_estrutura=e.id_estrutura and s.id_sala=?
                    where situacao_estrutura='A'
                order by desc_estrutura
                <sql:param value="${param.id_sala}"/>
            </sql:query>
            <table cellspacing="0">  <thead>
                    <th>Estrutura</th>
                </thead>
                <c:forEach var="row" items="${query.rows}">
                    <tr>
                        <td><input name="id_estrutura" type="checkbox" value="${row.id_estrutura}" ${row.id_sala==null?'':'checked'}> ${row.desc_estrutura}</td>
                    </tr>
                </c:forEach>
            </table>
        </p>
    </body>
</html>